var express = require('express');
var router = express.Router();
var mysql = require('mysql')
var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : '',
  database : 'his'
});
 connection.connect();
/* GET home page. */
router.get('/', (req, res, next) => {
	next();
},(req,res,next) => {
	console.log('router2');
  res.render('index', { title: 'Express1' });

});
router.get('/users/mysql', function(req, res, next) {
	connection.query('SELECT * from sys_user where user_phone = 13969617896', function (error, results, fields) {
	  if (error) throw error;
	 res.send(results);
	});	
});
module.exports = router;
